/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package smartgrid;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class DiaAgregadoDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression ID;
	public final DoubleExpression gastoSUM;
	public final StringExpression unidade;
	public final DoubleExpression precoSUM;
	public final DateExpression data;
	public final DoubleExpression gastoAVG;
	public final DoubleExpression precoAVG;
	
	public DiaAgregadoDetachedCriteria() {
		super(smartgrid.DiaAgregado.class, smartgrid.DiaAgregadoCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		gastoSUM = new DoubleExpression("gastoSUM", this.getDetachedCriteria());
		unidade = new StringExpression("unidade", this.getDetachedCriteria());
		precoSUM = new DoubleExpression("precoSUM", this.getDetachedCriteria());
		data = new DateExpression("data", this.getDetachedCriteria());
		gastoAVG = new DoubleExpression("gastoAVG", this.getDetachedCriteria());
		precoAVG = new DoubleExpression("precoAVG", this.getDetachedCriteria());
	}
	
	public DiaAgregadoDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, smartgrid.DiaAgregadoCriteria.class);
		ID = new IntegerExpression("ID", this.getDetachedCriteria());
		gastoSUM = new DoubleExpression("gastoSUM", this.getDetachedCriteria());
		unidade = new StringExpression("unidade", this.getDetachedCriteria());
		precoSUM = new DoubleExpression("precoSUM", this.getDetachedCriteria());
		data = new DateExpression("data", this.getDetachedCriteria());
		gastoAVG = new DoubleExpression("gastoAVG", this.getDetachedCriteria());
		precoAVG = new DoubleExpression("precoAVG", this.getDetachedCriteria());
	}
	
	public ContractDetachedCriteria createContractCriteria() {
		return new ContractDetachedCriteria(createCriteria("contract"));
	}
	
	public DiaAgregado uniqueDiaAgregado(PersistentSession session) {
		return (DiaAgregado) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public DiaAgregado[] listDiaAgregado(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (DiaAgregado[]) list.toArray(new DiaAgregado[list.size()]);
	}
}

